/*
 * @Author: 一路向阳 tt_sunzhenfeng@163.com
 * @Date: 2024-02-29 23:25:35
 * @LastEditors: 一路向阳 tt_sunzhenfeng@163.com
 * @LastEditTime: 2024-03-04 17:24:50
 * @FilePath: \utils_react_manager\server\router\word.js
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 */
const Router = require('koa-router');
const {
  wordList,
  learnWord,
  addWord,
  updateWord,
  count
} = require('../controller/wordController');

const router = new Router();

router.prefix('/word');

// 单词列表
router.post('/list', async ctx => {
  await wordList(ctx);
});

// 测试单词
router.post('/learn', async ctx => {
  await learnWord(ctx);
});

// 新增单词
router.post('/add', async ctx => {
  await addWord(ctx);
});

// 更新单词
router.post('/update', async ctx => {
  await updateWord(ctx);
});

// 熟悉单词
router.post('/count', async ctx => {
  await count(ctx);
});

module.exports = router;